const merge = require('webpack-merge')
const common = require('./webpack.common')

module.exports = merge(common, {
  mode: 'development',
  devtool: 'cheap-module-eval-source-map',
  output: {
    filename: '[name]-[hash:8].js'
  },
  devServer: {
    contentBase: './public', // 提供额外的静态资源目录,打包出的资源不需要设置
    port: 9010,
    historyApiFallback: true, // 响应404时返回index.html
    hot: true,
    host: 'localhost', // 其他机器访问本机
    proxy: {
      // 代理设置 跨域
      // '/api/*': {
      //     target: "http://127.0.0.1:8080",
      //     changeOrigin: true,
      //     pathRewrite: {
      //         '^/api': ""
      //     }
      // },
    }
  }
})
